package com.zb.spring5.ioc.inteface;

import com.zb.spring5.ioc.entity.Dependency;

public class ContextualizedDependencyLookup implements ManagedComponent {

    private Dependency dependency;

    /**
     * lookup的注入形式不太好,因为key可能会改变,或者返回的类型错误等
     * @param container
     */
    @Override
    public void performLookup(Container container) {
        this.dependency = (Dependency)container.getDependency("myDependency");
    }

    @Override
    public String toString() {
        return super.toString();
    }
}
